<#assign className = table.className>
<#assign classNameFirstLower = className?uncap_first>
<#assign classNameLowerCase = className?lower_case>
        <#if table.idColumn.javaType =="java.lang.Integer">
        <#assign pkJavaType = "java.lang.Long">
        <#else>
        <#assign pkJavaType = table.idColumn.javaType>
        </#if>

package ${model_package};


import lombok.Data;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.context.annotation.Lazy;
import ${commonNamespace}.support.ApplicationContextProvider;
import ${service_package}.I${className}Service;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.springframework.beans.BeanUtils;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
 * Description: <${className}Pojo vo>. <br>
 *
 * generate time:${.now}
 *
 * @author ${author}
 * @version V1.0
 */
@Data
public class ${className}Pojo implements Serializable{
	private static final long serialVersionUID = 1L;
	<#list table.columns as column>

	/*
	 * ${column.remarks}
	 */
	<#if column.pk>
		private ${pkJavaType} id;

	</#if>
	<#if !column.pk>
	<#if column.sqlName?ends_with("_fk")>
	private ${pkJavaType} ${column.columnNameFirstLower?replace("Fk","")};
	<#else>
	private ${column.javaType} ${column.columnNameFirstLower};
	</#if>

	</#if>


	</#list>

	/**
	 * 实体对象复制到数据对象
	 */
	public static ${className}Pojo wrapper(${className} ${classNameFirstLower}){
		${className}Pojo ${classNameFirstLower}Pojo = new ${className}Pojo();
		BeanUtils.copyProperties(${classNameFirstLower}, ${classNameFirstLower}Pojo);
		final I${className}Service ${classNameFirstLower}Service = (I${className}Service)ApplicationContextProvider.getBean("${classNameFirstLower}Service");

		return ${classNameFirstLower}Pojo;
	}


	/**
	 * 实体对象复制到数据对象List
	 */
	public static List<${className}Pojo> wrapper(List<${className}> ${classNameFirstLower}List) {
			List<${className}Pojo> ${className}PojoList = new ArrayList<>();
			for (${className} ${classNameFirstLower} : ${classNameFirstLower}List){
				${className}PojoList.add(${className}Pojo.wrapper(${classNameFirstLower}));
			}
			return ${className}PojoList;
		}

}



